<template>
	 <view v-if="visible" class="modal-overlay" @click.self="handleClose">
	    <view class="modal-container">
	      <view class="modal-content">
	        <slot></slot>
	      </view>
	      <view class="modal-actions">
			<button class="modal-button" @click="handleClose">取消</button>
			<button class="modal-button" @click="handleConfirm">确认</button>
	      
	      </view>
	    </view>
	  </view>
</template>

<script>
	export default {
	  props: {
	    visible: {
	      type: Boolean,
	      default: false
	    }
	  },
	  methods: {
	    handleClose() {
	      this.$emit('close');
	    },
	    handleConfirm() {
	      this.$emit('confirm');
	    }
	  }
	}
</script>

<style scoped>
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}
.modal-container {
  background: white;
  padding: 25px;
  border-radius: 15px;
  width: 85%;
  max-width: 300px;
  height: 85%;
  max-height: 150px;
}
.modal-content {
  margin-bottom: 20px;
  font-size: 19px;
  margin-left: 38px;
}
.modal-actions {
  display: flex;
  justify-content: space-between;
  padding-top: 11px;
}
.modal-button {
  background: #654bff;
  color: white;
  padding-top: 3px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  height: 40px;
  width: 80px;
  font-size: 15px;
  justify-content: center;
  
}

</style>
